<?php 
    
    $tmp = new XTemplate('sites/views/monhoc/add.html');
    //die('xxxxxxxxx');
    if($_POST){
        $monhoc = $_POST['monhoc'];
        print_r($monhoc);
        if(!$monhoc){
            echo "<script>alert('Mon hoc khong duoc bo trong')</script>";
            $save = -1;
        }
        if($save != -1){
            $sql = "INSERT INTO monhoc(tenmonhoc) VALUES('$monhoc')";
            $db->Execute($sql);
            header('Location: index.php');
        }
    }
    $tmp->parse('ADD');
    $maincontent = $tmp->text('ADD');
?>